import { actionTypeCreatorWithNameSpace, createAction } from './util';
import agent from 'agent';

const actionTypeCreator = actionTypeCreatorWithNameSpace('builder');

export const getLog = createAction(actionTypeCreator('getLog'), (logKey, url, offset) => {
  return agent.get(url)
    .query({ offset })
    .then(response => response.body);
}, (logKey) => {
  return {
    logKey
  };
});

export const clearLog = createAction(actionTypeCreator('clearLog'));
